#!/bin/sh
install=/usr/bin/install
DESTDIR=pkg
prefix=/usr
PREFIX=$prefix
install_prefix=/usr
shpp=shpp
APPNAME=shpp
VER=1.8
# if no sh_make instslled run it with tools/simple_shmake, just make shure that shpp is in $PATH

default() {
 shpp
}

prepare() {
 mkdir -p $DESTDIR/$PREFIX/bin
}

shpp() {
	sed -e "s|@GITREV@|$(../../tools/git_revgen)|" \
		-e "s|@VER@|$VER|"\
		shpp.in > shpp
}
install() {
  prepare
  install_shpp

}

tests() {
	load_module shmk_local/do_tests
	cd tests
	TESTFILES=$(find ! -iname "*~" -type f -iname \*.sh| tr '\n ' " ")
	do_tests "./../$APPNAME %f --stdout --errexit"
}
install_shpp() {
	$install shpp $DESTDIR/$PREFIX/bin/shpp
}
installer() {
  load_module configure
  load_module make_installer
  gen_installer > install.sh
}
